package com.jieli.bt.att

import android.app.Application
import android.content.Context
import com.jieli.logcat.JL_Log

/**
 * MyApplication
 * @author zqjasonZhong
 * @since 2025/3/27
 * @email zhongzhuocheng@zh-jieli.com
 * @desc 应用入口
 */
class MyApplication : Application() {

    companion object {
        lateinit var application: MyApplication
            private set
    }

    override fun onCreate() {
        super.onCreate()
        application = this

        //设置SDK Log配置
        initLog(this)
    }


    /**
     * 初始化打印日志
     */
    private fun initLog(context: Context) {
        val isLog = BuildConfig.DEBUG
        JL_Log.setLog(isLog)
        JL_Log.setSaveLogFile(isLog, context)
        if (isLog) {
            JL_Log.configure(JL_Log.getLogOption().apply {
                isLogcatCrash = true
            })
        }
    }
}